﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="DM_Ban.aspx.cs"
    Inherits="HoaDon.DM_Ban" Title="Danh mục bàn, phòng"%>

<asp:Content ID="cthoadon" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager>
    <br />
    <asp:Label ID="lbban" runat="server" Font-Bold="True" Font-Size="14pt" ForeColor="#663300"
        Text="DANH MỤC BÀN, PHÒNG"></asp:Label>
    <br />
    <br />
    <asp:Label ID="lbkhu" runat="server" Text="Khu vực, tầng "></asp:Label>
    <asp:DropDownList ID="drkhuvuc" runat="server" Height="20px" Width="150px" 
        onselectedindexchanged="drkhuvuc_SelectedIndexChanged" AutoPostBack="true">
    </asp:DropDownList>
    <br />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gdvban" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                ShowFooter="True" OnPageIndexChanging="OnPaging" OnRowEditing="EditDM" OnRowUpdating="UpdateDM"
                OnRowCancelingEdit="CancelEditDM">
                <AlternatingRowStyle BackColor="GradientActiveCaption" />
                <PagerStyle BackColor="WhiteSmoke" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="DodgerBlue" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#009933" />
                <Columns>
                    <asp:TemplateField HeaderText="Mã bàn">
                        <ItemTemplate>
                            <asp:Label ID="vvID" runat="server" Text='<%# Eval("vvID")%>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtvvID" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên bàn">
                        <ItemTemplate>
                            <asp:Label ID="vvName" runat="server" Text='<%# Eval("vvName")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="tbvvName" runat="server" Text='<%# Eval("vvName")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtvvName" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Button ID="btnEdit" runat="server" CommandArgument='<%# Eval("vvID")%>' Text="Sửa"
                                CommandName="Edit"></asp:Button>
                            <asp:Button ID="btnDedele" runat="server" CommandArgument='<%# Eval("vvID")%>' Text="Xóa"
                                OnClick="DeleteDM"></asp:Button>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:Button ID="btUpdate" runat="server" CommandArgument='<%# Eval("vvID")%>' Text="Đồng ý"
                                CommandName="Update" />
                            <asp:Button ID="btHuy" runat="server" CommandArgument='<%# Eval("vvID")%>' Text="Hủy"
                                CommandName="Cancel" />
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:Button ID="btnAdd" runat="server" Text="Thêm" OnClick="AddNewDM" />
                        </FooterTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Label ID="lbError" runat="server" ForeColor="Red"></asp:Label>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="gdvban" />
        </Triggers>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="drkhuvuc" EventName="SelectedIndexChanged" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
